import Vue from 'vue'
import App from './App' 
import http from './common/axios.js'
// 引入配置文件
import $C from './common/config.js';
import $U from './common/util'
App.mpType = 'app'  

 
const msg = (title, duration=1500, mask=false, icon='none')=>{
	//统一提示方便全局修改
	if(Boolean(title) === false){
		return;
	}
	uni.showToast({
		title,
		duration,
		mask,
		icon
	});
}
const prePage = ()=>{
	let pages = getCurrentPages();
	let prePage = pages[pages.length - 2];
	// #ifdef H5
	return prePage;
	// #endif
	return prePage.$vm;
}
Vue.prototype.$H = http
Vue.prototype.$C = $C
Vue.prototype.$U = $U
Vue.prototype.$api = {msg,http,prePage};
Vue.prototype.$getimg = $C.res_url	
Vue.prototype.$resurl = $C.res_url
Vue.prototype.shop_name = $C.shop_name 
Vue.prototype.$resimg = $C.res_url
Vue.prototype.$come_from = $C.Come_from
Vue.prototype.$S = $C.setConfig()  
 
App.mpType = 'app'

const app = new Vue({
    ...App
})
app.$mount()


